package Day02;

public class HomeWorkDemo {
    public static void main(String[] args) {
        int a;
        int b = 1,c = 2;
        a = 3;

        int g = 10;
        int h = g + 10;
        g = g + 10;
        System.out.println(h);
        System.out.println(g);

        //正确的
        int abc;
        int a1;
        int a$,_ad,$ad;

        //错误的
        //int ab@12;
        //int 12;
        //int class;//关键字不可
        //int 确实;//不建议

        int i1 = 23,i2 = 10;
        int result = i1/i2;
        System.out.println(result);
        int i3 = 111111111,i4 = 2111111111;
        System.out.println(i3+i4);


        long l1 = 1000000000000L,l2 =2000000000;
        long result2 = 1000000000 * 10 * 30L;
        long result3 = 1000000000L * 10 * 30;
        System.out.println("result2的值"+result2+"  result3的值"+result3);


        double d1 = 3 ,d2 = 2.9,d3 =5 ,d4 = 4.9;
        System.out.println("d1-d2的值:" + (d1-d2) +" d3-d4的值:" + (d3-d4));


        boolean b1 = false, b2 = true;

        char c1 = '男' ,c2 = 65535,c3 = 48,c4 = 65,c5 = 97,c6 = '4',c7 = '?',c8 = '\\',c9 = '\'';



        int iChange_1 = 12  ,iChange_2 = 300;//第二个溢出
        byte byteChange_1 = (byte) iChange_1,byteChange_2 = (byte) iChange_2;
        double doubleChange_1 = 10.1, doubleChange_2 = 2000000000000.0;
        int i_Catch_Double_1 = (int)doubleChange_1, i_Catch_Double_2 = (int)doubleChange_2;
        System.out.println("int转byte:" + byteChange_1 + " " + byteChange_2 + "\nint获取double失去精度和溢出" + i_Catch_Double_1 + " " + i_Catch_Double_2);

        byte byte_int_1 = 20, byte_int_2 = 30;
        byte byte_add = (byte)(byte_int_1 +byte_int_2);
        System.out.println(byte_add);
    }
}
